package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Team;
import cn.wolfcode.mapper.TeamMapper;
import cn.wolfcode.service.ITeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Ian
 * @date 2021/4/19 13:32
 */
@Service
public class TeamServiceImpl implements ITeamService {
    @Autowired
    private TeamMapper teamMapper;


    @Override
    public void deleteById(Long id) {
        teamMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void save(Team record) {
        teamMapper.insert(record);
    }

    @Override
    public Team get(Long id) {
        Team team = teamMapper.selectByPrimaryKey(id);
        return team;
    }

    @Override
    public List<Team> getAll() {
        List<Team> teams = teamMapper.selectAll();
        return teams;
    }

    @Override
    public void update(Team record) {
        teamMapper.updateByPrimaryKey(record);
    }
}
